package behavior.TemplateMethod;

/**
 * A test client
 */
public class Test {
	public static void main(String[] args) {
		// You should change the path of "test.txt" in your local machine
		String path = System.getProperty("user.dir");
		System.out.println(path);

		String fileName = path + "/src/TemplateMethod/src/" + "test.txt";
		String url = "http://www.baidu.com";

		AbstractRead fileRead = new ReadFile();
		AbstractRead htmlRead = new ReadHtml();

		fileRead.setResource(fileName);
		htmlRead.setResource(url);

		System.out.println("-----  Read from a file  -----");
		fileRead.getContent();
		System.out.println("-----  Read from a url  -----");
		htmlRead.getContent();
	}
}